package com.jpz.utils;

import java.util.List;

public class pageshow <T>{
	List<T> lis;//
	Integer count;//
	Object t;
	Integer start;
	Integer end;
	Integer toalPage;//
	Integer pagein;//
	public pageshow() {
		super();
	}
	public pageshow(List<T> lis, int count, Object t, int pagein) {
		super();
		this.lis = lis;
		this.count = count;
		this.t = t;
		this.pagein = pagein;
		this.toalPage = (count%4==0)?(count/4):((count/4)+1);
		if (toalPage <= 10) {
			this.start = 1;
			this.end = toalPage;
		} else {
			this.start = pagein - 4;
			this.end = pagein + 5;
			if (this.start < 1) {
				this.start = 1;
				this.end = 10;
			}
			else if (this.end > toalPage) {
				this.end = toalPage;
				this.start = toalPage - 9;
			}
			if (this.end >= toalPage) {
				this.end = toalPage;
			}
		}
	}
	public List<T> getLis() {
		return lis;
	}
	public void setLis(List<T> lis) {
		this.lis = lis;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public Object getT() {
		return t;
	}
	public void setT(Object t) {
		this.t = t;
	}
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getEnd() {
		return end;
	}
	public void setEnd(int end) {
		this.end = end;
	}
	public int getToalPage() {
		return toalPage;
	}
	public void setToalPage(int toalPage) {
		this.toalPage = toalPage;
	}
	public int getPagein() {
		return pagein;
	}
	public void setPagein(int pagein) {
		this.pagein = pagein;
	}	
}
